package view.panel.feed
{
	import control.FamousPanelControl;
	import control.panel.IPanelControl;
	
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	import utils.TextTool;
	
	import view.components.ImgButton;
	import view.panel.AbsPanel;
	
	public class FamousPanel extends AbsPanel
	{
		private var titleHint:TextField;
		public var input:*;
		
		public function FamousPanel(panelControl:IPanelControl)
		{
			super(panelControl);
			resetBg(364,210,1,true);
			initCloseBut();
			resetCloseBut();
			initTitle("text_title_famous");
			dropShadow();
			initTweenPanelOpen();
			
			initTitleHint();
			initBut();
			initInput();
		}
		
		private function initInput():void
		{
			input = TextTool.getTextArea(310,68,true);
			input.textField.maxChars = 50;
			input.x = 20;
			input.y = 60;
			addChild(input);
		}
		
		private function initTitleHint():void
		{
			var content:String = "    在这里可以发表你的经典语录，一旦被我们采用，将会广为流传，不但可以名扬四海，还可以获得不少奖励哦！";
			titleHint = TextTool.getTextFieldXY(20,20,310,40,12,0xFFFFFF,content);
			titleHint.multiline = true;
			titleHint.wordWrap = true;
			
			addChild(titleHint);
			
			addChild(TextTool.getTextFieldXY(135,135,140,20,12,0xFFFFFF,"限定5-50个字"));
		}
		
		public function get content():String
		{
			return input.text;
		}
		
		private function initBut():void
		{
			addChild(new ImgButton(105,170,0,onBut,50,20,"butBg",null,"确定"));
			addChild(new ImgButton(205,170,1,onBut,50,20,"butBg",null,"取消"));
		}
		
		private function onBut(event:MouseEvent):void
		{
			(panelControl as FamousPanelControl).onBut(event.target.id);
		}
	}
}